<?php

namespace Kateba\RestaurantBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Kateba\RestaurantBundle\Entity\ExtraPrice
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Kateba\RestaurantBundle\Entity\ExtraPriceRepository")
 */
class ExtraPrice {

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var Kateba\RestaurantBundle\Entity\Extra $extra
     * @ORM\ManyToOne(targetEntity="Kateba\RestaurantBundle\Entity\Extra", inversedBy="prices")
     * @ORM\JoinColumn(name="extraId", referencedColumnName="id", onDelete="CASCADE", onUpdate="CASCADE", nullable=false)
     */
    private $extra;

    /**
     * @var Kateba\RestaurantBundle\Entity\Category $category
     * @ORM\ManyToOne(targetEntity="Kateba\RestaurantBundle\Entity\Category", inversedBy="extras")
     * @ORM\JoinColumn(name="categoryId", referencedColumnName="id", onDelete="CASCADE", onUpdate="CASCADE", nullable=false)
     */
    private $category;

    /**
     * @var Doctrine\Common\Collections\ArrayCollection $ordersDetails
     * 
     * @ORM\OneToMany(targetEntity="Kateba\OrderBundle\Entity\OrderDetail", mappedBy="extraPrice", cascade={"all"}, orphanRemoval=true)
     */
    private $ordersDetails;

    /**
     * @var integer $size
     *
     * @ORM\Column(name="size", type="integer")
     */
    private $size;

    /**
     * @var decimal $price
     *
     * @ORM\Column(name="price", type="decimal", precision=10, scale=2)
     */
    private $price;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set size
     *
     * @param integer $size
     */
    public function setSize($size) {
        $this->size = $size;
    }

    /**
     * Get size
     *
     * @return integer 
     */
    public function getSize() {
        return $this->size;
    }

    /**
     * Set price
     *
     * @param decimal $price
     */
    public function setPrice($price) {
        $this->price = $price;
    }

    /**
     * Get price
     *
     * @return decimal 
     */
    public function getPrice() {
        return $this->price;
    }

    public function __construct() {
        $this->ordersDetails = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Set extra
     *
     * @param Kateba\RestaurantBundle\Entity\Extra $extra
     */
    public function setExtra(\Kateba\RestaurantBundle\Entity\Extra $extra) {
        $this->extra = $extra;
    }

    /**
     * Get extra
     *
     * @return Kateba\RestaurantBundle\Entity\Extra 
     */
    public function getExtra() {
        return $this->extra;
    }

    /**
     * Set category
     *
     * @param Kateba\RestaurantBundle\Entity\Category $category
     */
    public function setCategory(\Kateba\RestaurantBundle\Entity\Category $category) {
        $this->category = $category;
    }

    /**
     * Get category
     *
     * @return Kateba\RestaurantBundle\Entity\Category 
     */
    public function getCategory() {
        return $this->category;
    }

    /**
     * Add ordersDetails
     *
     * @param Kateba\OrderBundle\Entity\OrderDetail $ordersDetails
     */
    public function addOrderDetail(\Kateba\OrderBundle\Entity\OrderDetail $ordersDetails) {
        $this->ordersDetails[] = $ordersDetails;
    }

    /**
     * Get ordersDetails
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getOrdersDetails() {
        return $this->ordersDetails;
    }

}